#include<iostream>
#include<string>
#include<cmath>
using namespace std;
const int N = 110;
int f[N];
int n;
string s;
int main()
{
	cin >> n;
	cin >> s;
	for (int i = 0; i < 3; i++) {
		/*if (s[i] == 'X') {
			if (!i)f[i] = 1;
			else f[i] = f[i - 1] + 1;
		}*/
		f[i] = (s[i] == 'X');
	}
	for (int i = 3; i < n; i++) {
		f[i] =  min(f[i - 1], min(f[i - 2], f[i - 3])) + (s[i] == 'X');
	}
	/*for (int i = 0; i < n; i++) {
		cout << "i== " << i << "  f[i]==" << f[i] << endl;
	}*/
	cout << f[n - 1] << endl;
	return 0;
}